package com.xyh.service.impl;

import com.xyh.dao.IUserDao;
import com.xyh.po.User;
import com.xyh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.zip.ZipEntry;

/**
 * @Author:kyle
 * @Date:2020/12/14 - 12:46
 * @Project:spring_demo1
 * @Package:com.xyh.service.impl
 * @Version:1.0
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired //自动装配注入属性，通过类名找到对应属性（和名字无关）
    @Qualifier("userDao")//只根据名字来注入，如果没有则不注入
    private IUserDao userDao;

    @Override
    @Transactional
    public boolean updateUser(User user) {
        int i = userDao.updateUser(user);
        return i>0?true:false;
    }
}
